/*
 * LastError.cpp
 *
 *  Created on: 2012-12-7
 *      Author: yangentao@gmail.com
 */

#include "LastError.h"

#include "StreamLog.h"
#include "win32.h"

namespace yet {

LastError::LastError() {
	code = GetLastError();
}

LastError::~LastError() {
}
DWORD LastError::getCode() {
	return code;
}
string LastError::getMessage() {
	return formatMessage(code);
}

void LastError::print(){
	slog<<err<<code<<":"<<getMessage()<<endln;
}

} /* namespace yet */
